home *** CD-ROM | disk | FTP | other *** search
/ PC Media 2 / PC MEDIA CD02.iso / share / udos / dosmon / dosmon.log < prev   
Encoding:
Text File  |  1986-05-16  |  11.2 KB  |  399 lines

  1. -f100 500 0
  2.  
  3. -a100
  4.  
  5. 1149:0100 ;
  6.  
  7. 1149:0100 ;----------------------------------------
  8.  
  9. 1149:0100 ; DOSMON - DOS Activity Monitor
  10.  
  11. 1149:0100 ;----------------------------------------
  12.  
  13. 1149:0100 ;
  14.  
  15. 1149:0100 ; This program will terminate and stay resident.  It intercepts the
  16.  
  17. 1149:0100 ; DOS service interrupt and displays status information on the
  18.  
  19. 1149:0100 ; screen during DOS service execution periods.
  20.  
  21. 1149:0100 ;
  22.  
  23. 1149:0100 ; S.H.Smith, 15-may-86
  24.  
  25. 1149:0100 ;
  26.  
  27. 1149:0100 
  28.  
  29. -
  30.  
  31. -a100
  32.  
  33. 1149:0100 ;----------------------------------------
  34.  
  35. 1149:0100 ; startup entry point
  36.  
  37. 1149:0100 ;----------------------------------------
  38.  
  39. 1149:0100    jmp 2e0       ;install
  40.  
  41. 1149:0103 
  42.  
  43. -
  44.  
  45. -a103
  46.  
  47. 1149:0103 ; vector for old interrupt
  48.  
  49. 1149:0103    db 0,0,0,0
  50.  
  51. 1149:0107 
  52.  
  53. -
  54.  
  55. -a107
  56.  
  57. 1149:0107 ; segment address for display memory
  58.  
  59. 1149:0107 ; filled in by startup code
  60.  
  61. 1149:0107    dw 0
  62.  
  63. 1149:0109 
  64.  
  65. -
  66.  
  67. -a10e
  68.  
  69. 1149:010E ; twiddle display index
  70.  
  71. 1149:010E    dw 0
  72.  
  73. 1149:0110 
  74.  
  75. -
  76.  
  77. -a110
  78.  
  79. 1149:0110 ; twiddle display characters
  80.  
  81. 1149:0110    db "─\│/"
  82.  
  83. 1149:0114 
  84.  
  85. -
  86.  
  87. -a118
  88.  
  89. 1149:0118 ; 118..11B used for vector back to user
  90.  
  91. 1149:0118 ; 11c used for first save char
  92.  
  93. 1149:0118 ; 11e used for second save char
  94.  
  95. 1149:0118 ; 120 used for third save char
  96.  
  97. 1149:0118 ; 122 scratch ax save
  98.  
  99. 1149:0118 ; 124 ss save
  100.  
  101. 1149:0118 ; 126 sp save
  102.  
  103. 1149:0118 
  104.  
  105. -
  106.  
  107. -a130
  108.  
  109. 1149:0130 ; a signature in bytes
  110.  
  111. 1149:0130    db 0a,0d,'DOSMON - DOS Activity Monitor',0a,0d
  112.  
  113. 1149:0151    db '$  S.H.Smith, 15-May-86',0a,0d
  114.  
  115. 1149:016A    db 1a
  116.  
  117. 1149:016B 
  118.  
  119. -
  120.  
  121. -a170
  122.  
  123. 1149:0170 ;----------------------------------------
  124.  
  125. 1149:0170 ; new DOS service interrupt
  126.  
  127. 1149:0170 ;----------------------------------------
  128.  
  129. 1149:0170 ;
  130.  
  131. 1149:0170    cs:
  132.  
  133. 1149:0171    pop [118]       ;get return ip
  134.  
  135. 1149:0175    cs:
  136.  
  137. 1149:0176    pop [11a]       ;get return cs
  138.  
  139. 1149:017A    popf            ;get flags
  140.  
  141. 1149:017B ;
  142.  
  143. 1149:017B    pushf
  144.  
  145. 1149:017C    push ds
  146.  
  147. 1149:017D    push es
  148.  
  149. 1149:017E    push bx         ;save entry registers
  150.  
  151. 1149:017F    push ax
  152.  
  153. 1149:0180 ;
  154.  
  155. 1149:0180 ;----------------------------------------
  156.  
  157. 1149:0180 ; save the previous display data
  158.  
  159. 1149:0180 ;
  160.  
  161. 1149:0180    cs:
  162.  
  163. 1149:0181    mov ax,[107]    ;get display segment into es
  164.  
  165. 1149:0184    mov es,ax
  166.  
  167. 1149:0186 ;
  168.  
  169. 1149:0186    es:
  170.  
  171. 1149:0187    mov ax,[94]     ;save original screen contents
  172.  
  173. 1149:018A    cs:
  174.  
  175. 1149:018B    mov [11c],ax
  176.  
  177. 1149:018E ;
  178.  
  179. 1149:018E    es:
  180.  
  181. 1149:018F    mov ax,[96]     ;second char
  182.  
  183. 1149:0192    cs:
  184.  
  185. 1149:0193    mov [11e],ax
  186.  
  187. 1149:0196 ;
  188.  
  189. 1149:0196    es:
  190.  
  191. 1149:0197    mov ax,[98]     ;third char
  192.  
  193. 1149:019A    cs:
  194.  
  195. 1149:019B    mov [120],ax
  196.  
  197. 1149:019E ;
  198.  
  199. 1149:019E ;----------------------------------------
  200.  
  201. 1149:019E ; prepare display with blanks
  202.  
  203. 1149:019E ;
  204.  
  205. 1149:019E    mov ax,0f20     ;space with attribute of 15
  206.  
  207. 1149:01A1    es:
  208.  
  209. 1149:01A2    mov [94],ax
  210.  
  211. 1149:01A5    es:
  212.  
  213. 1149:01A6    mov [96],ax     ;set attribute of the function code locations
  214.  
  215. 1149:01A9    es:             ;and leave them blank in case of 'exec' function
  216.  
  217. 1149:01AA    mov [98],ax
  218.  
  219. 1149:01AD ;
  220.  
  221. 1149:01AD    pop ax          ;get DOS function code into ah
  222.  
  223. 1149:01AE    push ax
  224.  
  225. 1149:01AF ;
  226.  
  227. 1149:01AF    cmp ah,4b       ;is this an exec call?
  228.  
  229. 1149:01B2    jz 228          ;leave display blank if so
  230.  
  231. 1149:01B4 ;
  232.  
  233. 1149:01B4 ;----------------------------------------
  234.  
  235. 1149:01B4 ; display the rotating twiddle character
  236.  
  237. 1149:01B4 ;
  238.  
  239. 1149:01B4    cs:
  240.  
  241. 1149:01B5    mov bx,[10e]    ;get twiddle index
  242.  
  243. 1149:01B9    inc bx
  244.  
  245. 1149:01BA    mov al,bl       ;advance to next twiddle position
  246.  
  247. 1149:01BC    and al,3        ;bx=bx mod 4 to rotate through twiddles
  248.  
  249. 1149:01BE    mov bl,al
  250.  
  251. 1149:01C0    cs:
  252.  
  253. 1149:01C1    mov [10e],bx    ;save next twiddle index
  254.  
  255. 1149:01C5 ;
  256.  
  257. 1149:01C5    cs:
  258.  
  259. 1149:01C6    mov ah,[110+bx] ;get the next twiddle character
  260.  
  261. 1149:01CA    es:
  262.  
  263. 1149:01CB    mov [94],ah     ;put twiddle status on screen
  264.  
  265. 1149:01CF ;
  266.  
  267. 1149:01CF ;----------------------------------------
  268.  
  269. 1149:01CF ; display the DOS service number in hex
  270.  
  271. 1149:01CF ;
  272.  
  273. 1149:01CF    pop ax          ;get the dos function code into ah
  274.  
  275. 1149:01D0    push ax
  276.  
  277. 1149:01D1 ;
  278.  
  279. 1149:01D1    and ah,0f
  280.  
  281. 1149:01D4    add ah,30       ;convert low digit to hex
  282.  
  283. 1149:01D7 ;
  284.  
  285. 1149:01D7    cmp ah,3a       ;handle A..F
  286.  
  287. 1149:01DA    jb 1e8
  288.  
  289. 1149:01DC    add ah,7
  290.  
  291. 1149:01DF    jmp 1e8
  292.  
  293. 1149:01E1 
  294.  
  295. -
  296.  
  297. -a1e8
  298.  
  299. 1149:01E8    es:
  300.  
  301. 1149:01E9    mov [98],ah     ;and set LSB on screen
  302.  
  303. 1149:01ED ;
  304.  
  305. 1149:01ED    pop ax          ;get fresh copy of function code into ah
  306.  
  307. 1149:01EE    push ax
  308.  
  309. 1149:01EF ;
  310.  
  311. 1149:01EF    shr ah,1        ;move down bits for high digit
  312.  
  313. 1149:01F1    shr ah,1
  314.  
  315. 1149:01F3    shr ah,1
  316.  
  317. 1149:01F5    shr ah,1        ;make high byte hex and put on screen
  318.  
  319. 1149:01F7    and ah,0f
  320.  
  321. 1149:01FA    add ah,30
  322.  
  323. 1149:01FD ;
  324.  
  325. 1149:01FD    cmp ah,3a       ;handle A..F
  326.  
  327. 1149:0200    jb 218
  328.  
  329. 1149:0202    add ah,7
  330.  
  331. 1149:0205    jmp 218
  332.  
  333. 1149:0207 
  334.  
  335. -
  336.  
  337. -a218
  338.  
  339. 1149:0218    es:
  340.  
  341. 1149:0219    mov [96],ah     ;set MSB on screen
  342.  
  343. 1149:021D    jmp 228
  344.  
  345. 1149:021F 
  346.  
  347. -
  348.  
  349. -a228
  350.  
  351. 1149:0228 ;----------------------------------------
  352.  
  353. 1149:0228 ; perform the DOS service function
  354.  
  355. 1149:0228 ;
  356.  
  357. 1149:0228    pop ax
  358.  
  359. 1149:0229    pop bx
  360.  
  361. 1149:022A    pop es          ;restore initial entry registers
  362.  
  363. 1149:022B    pop ds
  364.  
  365. 1149:022C    popf
  366.  
  367. 1149:022D ;
  368.  
  369. 1149:022D    cs:
  370.  
  371. 1149:022E    push [118]
  372.  
  373. 1149:0232    cs:             ;push static variables to make this program
  374.  
  375. 1149:0233    push [11a]      ;recursive - DOS uses many recursive functions
  376.  
  377. 1149:0237    cs:
  378.  
  379. 1149:0238    push [11c]
  380.  
  381. 1149:023C    cs:
  382.  
  383. 1149:023D    push [11e]
  384.  
  385. 1149:0241    cs:
  386.  
  387. 1149:0242    push [120]
  388.  
  389. 1149:0246    cs:
  390.  
  391. 1149:0247    push [124]
  392.  
  393. 1149:024B    cs:
  394.  
  395. 1149:024C    push [126]
  396.  
  397. 1149:0250 ;
  398.  
  399. 1149:0250    cs:
  400.  
  401. 1149:0251    mov [122],ax
  402.  
  403. 1149:0254    mov ax,ss
  404.  
  405. 1149:0256    cs:
  406.  
  407. 1149:0257    mov [124],ax    ;preserve ss:sp in case dos loses it!
  408.  
  409. 1149:025A    mov ax,sp
  410.  
  411. 1149:025C    cs:
  412.  
  413. 1149:025D    mov [126],ax
  414.  
  415. 1149:0260    cs:
  416.  
  417. 1149:0261    mov ax,[122]
  418.  
  419. 1149:0264 ;
  420.  
  421. 1149:0264    pushf           ;push flags to simulate action of 'int 21'
  422.  
  423. 1149:0265    cs:
  424.  
  425. 1149:0266    call far [103]  ;call the real DOS service interrupt
  426.  
  427. 1149:026A ;
  428.  
  429. 1149:026A    cs:
  430.  
  431. 1149:026B    mov [122],ax
  432.  
  433. 1149:026E    cs:
  434.  
  435. 1149:026F    mov ax,[124]    ;restore ss:sp
  436.  
  437. 1149:0272    mov ss,ax
  438.  
  439. 1149:0274    cs:
  440.  
  441. 1149:0275    mov ax,[126]
  442.  
  443. 1149:0278    mov sp,ax
  444.  
  445. 1149:027A    cs:
  446.  
  447. 1149:027B    mov ax,[122]
  448.  
  449. 1149:027E ;
  450.  
  451. 1149:027E    cs:
  452.  
  453. 1149:027F    pop [126]
  454.  
  455. 1149:0283    cs:
  456.  
  457. 1149:0284    pop [124]
  458.  
  459. 1149:0288    cs:
  460.  
  461. 1149:0289    pop [120]
  462.  
  463. 1149:028D    cs:
  464.  
  465. 1149:028E    pop [11e]       ;restore static variables after return from recursion
  466.  
  467. 1149:0292    cs:
  468.  
  469. 1149:0293    pop [11c]
  470.  
  471. 1149:0297    cs:
  472.  
  473. 1149:0298    pop [11a]
  474.  
  475. 1149:029C    cs:
  476.  
  477. 1149:029D    pop [118]
  478.  
  479. 1149:02A1 ;
  480.  
  481. 1149:02A1    pushf
  482.  
  483. 1149:02A2    push ax         ;save DOS exit registers for later use
  484.  
  485. 1149:02A3    push es
  486.  
  487. 1149:02A4    push ds
  488.  
  489. 1149:02A5 ;
  490.  
  491. 1149:02A5 ;----------------------------------------
  492.  
  493. 1149:02A5 ; restore original screen contents
  494.  
  495. 1149:02A5 ;
  496.  
  497. 1149:02A5    cs:
  498.  
  499. 1149:02A6    mov ax,[107]    ;get display page into es
  500.  
  501. 1149:02A9    mov es,ax
  502.  
  503. 1149:02AB ;
  504.  
  505. 1149:02AB    cs:
  506.  
  507. 1149:02AC    mov ax,[11c]
  508.  
  509. 1149:02AF    es:            ;put old data on screen
  510.  
  511. 1149:02B0    mov [94],ax    ;first char
  512.  
  513. 1149:02B3 ;
  514.  
  515. 1149:02B3    cs:
  516.  
  517. 1149:02B4    mov ax,[11e]
  518.  
  519. 1149:02B7    es:
  520.  
  521. 1149:02B8    mov [96],ax    ;second char
  522.  
  523. 1149:02BB ;
  524.  
  525. 1149:02BB    cs:
  526.  
  527. 1149:02BC    mov ax,[120]
  528.  
  529. 1149:02BF    es:
  530.  
  531. 1149:02C0    mov [98],ax    ;third char
  532.  
  533. 1149:02C3 ;
  534.  
  535. 1149:02C3 ;----------------------------------------
  536.  
  537. 1149:02C3 ; end of interrupt - return to the caller
  538.  
  539. 1149:02C3 ;
  540.  
  541. 1149:02C3    pop ds
  542.  
  543. 1149:02C4    pop es
  544.  
  545. 1149:02C5    pop ax
  546.  
  547. 1149:02C6    popf             ;get return flags
  548.  
  549. 1149:02C7    cs:
  550.  
  551. 1149:02C8    jmp far [118]    ;jump back to user code
  552.  
  553. 1149:02CC 
  554.  
  555. -
  556.  
  557. -a2e0
  558.  
  559. 1149:02E0 ;----------------------------------------
  560.  
  561. 1149:02E0 ; startup code
  562.  
  563. 1149:02E0 ;----------------------------------------
  564.  
  565. 1149:02E0 ; determine where the video ram is.  this is done by putting a special
  566.  
  567. 1149:02E0 ; character on the screen and then looking for it in the various video
  568.  
  569. 1149:02E0 ; ram locations.
  570.  
  571. 1149:02E0 ;
  572.  
  573. 1149:02E0    push cs
  574.  
  575. 1149:02E1    pop ds
  576.  
  577. 1149:02E2 ;
  578.  
  579. 1149:02E2    mov ah,3         ;get cursor position
  580.  
  581. 1149:02E4    int 10           ;video bios service
  582.  
  583. 1149:02E6    push ax
  584.  
  585. 1149:02E7    push bx
  586.  
  587. 1149:02E8    push dx          ;save it for later
  588.  
  589. 1149:02E9 ;
  590.  
  591. 1149:02E9    mov dx,0
  592.  
  593. 1149:02EC    mov ah,2         ;home the cursor
  594.  
  595. 1149:02EE    int 10
  596.  
  597. 1149:02F0 ;
  598.  
  599. 1149:02F0    mov ah,0A
  600.  
  601. 1149:02F2    mov al,88        ;display a funny char at cursor
  602.  
  603. 1149:02F4    mov cx,1
  604.  
  605. 1149:02F7    int 10
  606.  
  607. 1149:02F9 ;
  608.  
  609. 1149:02F9 ; move cursor back to original position
  610.  
  611. 1149:02F9 ;
  612.  
  613. 1149:02F9    pop dx
  614.  
  615. 1149:02FA    pop bx
  616.  
  617. 1149:02FB    pop ax
  618.  
  619. 1149:02FC    mov ah,2
  620.  
  621. 1149:02FE    int 10
  622.  
  623. 1149:0300 ;
  624.  
  625. 1149:0300 ; look for MONO video ram
  626.  
  627. 1149:0300 ;
  628.  
  629. 1149:0300    mov dl,88
  630.  
  631. 1149:0302    mov ax,b000
  632.  
  633. 1149:0305    mov es,ax
  634.  
  635. 1149:0307    es:
  636.  
  637. 1149:0308    cmp dl,[0]
  638.  
  639. 1149:030C    jz 360
  640.  
  641. 1149:030E ;
  642.  
  643. 1149:030E ; look for COLOR video ram
  644.  
  645. 1149:030E ;
  646.  
  647. 1149:030E    mov ax,b800
  648.  
  649. 1149:0311    mov es,ax
  650.  
  651. 1149:0313    es:
  652.  
  653. 1149:0314    cmp dl,[0]
  654.  
  655. 1149:0318    jz 360
  656.  
  657. 1149:031A ;
  658.  
  659. 1149:031A ; couldn't find video ram; display a message and abort
  660.  
  661. 1149:031A ;
  662.  
  663. 1149:031A    mov dx,308
  664.  
  665. 1149:031D    mov ah,9
  666.  
  667. 1149:031F    int 21           ;display error message
  668.  
  669. 1149:0321    int 20           ;terminate program
  670.  
  671. 1149:0323 
  672.  
  673. -
  674.  
  675. -a328
  676.  
  677. 1149:0328    db "ERROR: Can't find display memory$"
  678.  
  679. 1149:0349 
  680.  
  681. -
  682.  
  683. -a360
  684.  
  685. 1149:0360 ;
  686.  
  687. 1149:0360    cs:
  688.  
  689. 1149:0361    mov [107],ax     ;set the display segment
  690.  
  691. 1149:0364 ;
  692.  
  693. 1149:0364 ;----------------------------------------
  694.  
  695. 1149:0364 ; display the program signon message now that we are sure
  696.  
  697. 1149:0364 ; that we can be installed
  698.  
  699. 1149:0364 ;
  700.  
  701. 1149:0364    mov dx,130
  702.  
  703. 1149:0367    mov ah,9
  704.  
  705. 1149:0369    int 21           ;display signon message
  706.  
  707. 1149:036B ;
  708.  
  709. 1149:036B ;----------------------------------------
  710.  
  711. 1149:036B ; now install new interrupt handler
  712.  
  713. 1149:036B ;
  714.  
  715. 1149:036B    mov ax,0
  716.  
  717. 1149:036E    mov es,ax
  718.  
  719. 1149:0370 ;
  720.  
  721. 1149:0370 ; save old DOS service vector
  722.  
  723. 1149:0370 ;
  724.  
  725. 1149:0370    es:
  726.  
  727. 1149:0371    mov ax,[84]
  728.  
  729. 1149:0374    cs:
  730.  
  731. 1149:0375    mov [103],ax
  732.  
  733. 1149:0378 ;
  734.  
  735. 1149:0378    es:
  736.  
  737. 1149:0379    mov ax,[86]
  738.  
  739. 1149:037C    cs:
  740.  
  741. 1149:037D    mov [105],ax
  742.  
  743. 1149:0380 ;
  744.  
  745. 1149:0380 ; install new vector
  746.  
  747. 1149:0380 ;
  748.  
  749. 1149:0380    mov ax,170       ;entry point offset
  750.  
  751. 1149:0383    es:
  752.  
  753. 1149:0384    mov [84],ax
  754.  
  755. 1149:0387 ;
  756.  
  757. 1149:0387    mov ax,cs        ;this code segment
  758.  
  759. 1149:0389    es:
  760.  
  761. 1149:038A    mov [86],ax
  762.  
  763. 1149:038D ;
  764.  
  765. 1149:038D ; set last resident code offset
  766.  
  767. 1149:038D ; and terminate-and-stay-resident
  768.  
  769. 1149:038D ;
  770.  
  771. 1149:038D    mov al,0         ;exit code
  772.  
  773. 1149:038F    mov dx,30        ;paragraphs to keep resident
  774.  
  775. 1149:0392    mov ah,31        ;keep process function
  776.  
  777. 1149:0394    int 21           ;terminate and stay in memory
  778.  
  779. 1149:0396 
  780.  
  781. -
  782.  
  783. -rcx
  784.  
  785. CX 0000
  786. :400
  787.  
  788. -ndosmon.com
  789.  
  790. -w
  791.  
  792. Writing 0400 bytes
  793. -q
  794.  
  795.